<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../lib/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="../lib/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../lib/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../lib/jquery.serializeJSON/jquery.serializejson.min.js"></script>
    <script type="text/javascript" src="../lib/jquery.rest/dist/1/jquery.rest.min.js"></script>

    <script>
        Date.prototype.format = function (format) {
            var date = {
                "M+": this.getMonth() + 1,
                "d+": this.getDate(),
                "h+": this.getHours(),
                "m+": this.getMinutes(),
                "s+": this.getSeconds(),
                "q+": Math.floor((this.getMonth() + 3) / 3),
                "S+": this.getMilliseconds()
            };
            if (/(y+)/i.test(format)) {
                format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
            }
            for (var k in date) {
                if (new RegExp("(" + k + ")").test(format)) {
                    format = format.replace(RegExp.$1, RegExp.$1.length == 1
                            ? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
                }
            }
            return format;
        }
    </script>
    <link href="../lib/easyui/themes/bootstrap/easyui.css" rel="stylesheet">
</head>
<body class="easyui-layout" fit="true">
<div region="west" title="部门成员" style="width: 100px"></div>
<div region="center">
    <div id="user_tb">
        <form>
            <a class="easyui-linkbutton" href="#" onclick=" $('#user_add_dlg').dialog({
       closed:false
   })">注册</a>
            <a class="easyui-linkbutton" href="#" onclick="userManger.deleteUser()">删除</a>
            <a class="easyui-linkbutton" href="#" onclick=" $('#user_add_dlg').dialog({
       closed:false
   })">通过审核</a>
            <a class="easyui-linkbutton" href="#" onclick=" $('#user_add_dlg1').dialog({
       closed:false
   })">通过审核</a>

            <label>姓名:</label><input class="easyui-textbox" name="name">
            <a class="easyui-linkbutton" href="#" onclick="userManger.search()">查询员工</a></form>
    </div>
    <table id="users" title="员工管理">
        <thead>
        <tr>
            <th field="id">标识</th>
            <th field="name">姓名</th>
            <th field="inTime">出勤</th>
            <th field="outTime">退勤</th>
            <th field="memo">备注</th>
        </tr>
        </thead>
    </table>
</div>

<div id="user_add_dlg" title="添加成员" class="easyui-dialog" data-options="closed:true">
    <form>
        <label>姓名</label> <input name="name" class="easyui-textbox" title="姓名:">
    </form>
    <a class="easyui-linkbutton" onclick="userManger.save($('#user_add_dlg form').serializeJSON())">保存</a> <a
        class="easyui-linkbutton" onclick="$('#user_add_dlg form').from('reset');">取消</a>
</div>
<div id="user_edit_dlg" title="修改员工信息" class="easyui-dialog" data-options="closed:true">
    <form>
        <input type="hidden" name="id">
        <label>姓名</label> <input name="name" class="easyui-textbox" title="姓名:">
    </form>
    <a class="easyui-linkbutton" onclick="userManger.update({})">保存</a> <a class="easyui-linkbutton"
                                                                           onclick="$('#user_add_dlg form').from('reset');">取消</a>
</div>
<div id="user_edit_dlg1" title="修改员工信息" class="easyui-dialog" data-options="closed:true">
    <form>
        <input type="hidden" name="id">
        <label>姓名</label> <input name="name" class="easyui-textbox" title="姓名:">
    </form>
    <a class="easyui-linkbutton" onclick="userManger.update({})">保存</a> <a class="easyui-linkbutton"
                                                                           onclick="$('#user_add_dlg form').from('reset');">取消</a>
</div>


<script type="text/javascript" src="../js/UserManger.js"></script>
<script type="text/javascript">
    var userManger = new User('#users', '#user_add_dlg', '#user_edit_dlg', '#user_tb', '../attendance.json', '../attendance', function (d) {
        console.log(d);
    })
</script>
</body>
</html>